<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>教师管理</title>
    <link rel="stylesheet" type="text/css" href="/thinkphp5/public/static/bootstrap-3.3.5-dist/css/bootstrap.min.css">
</head>
<body class="container">
<div class="row">
    <hr>
    <div class="col-md-8">
        <form class="form-inline">
            <div class="form-group">
                <label class="sr-only" for="name">姓名</label>
                <input name="name" type="text" class="form-control" placeholder="姓名..." value="{:input('get.name')}">
            </div>
            <button type="submit" class="btn btn-default" ><i class="glyphicon glyphicon-search">&nbsp;查询</i></button>
        </form>
    </div>
    <div class="col-md-4 text-right">
        <a href="{:url('add')}" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i>&nbsp;增加</a>
    </div>
    <hr>
</div>
<div class="row">
    <div class="col-md-12">
        <table class="table table-hover table-bordered">
            <tr>
                <th>序号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>邮箱</th>
                <th>用户名</th>
                <th>操作</th>
            </tr>

            {volist name="teachers" id="teacher" key="key"}
            <tr>
                <td>{$key}</td>
                <td>{$teacher->getData('name')}</td>
                <td>{eq name='$teacher->getData("sex")' value='0'}男{else /}女{/eq}</td>
                <td>{$teacher->getData('email')}</td>
                <td>{$teacher->getData('username')}</td>
                <td><a class="btn btn-default" href="{:url('edit?id='.$teacher->getData('id'))}">编辑</a>
                    &nbsp;&nbsp;
                    <a class="btn btn-default" href="{:url('delete?id='.$teacher->getData('id'))}">删除</a></td>
            </tr>
            {/volist}

        </table>
        {$teachers->render()}
    </div>
</div>


</body>
</html>
